package com.yunxin.core.infra.persistence.mapper.user;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.yunxin.core.domain.model.user.UserAuth;
import com.yunxin.core.infra.persistence.entity.user.UserAuthDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * @author zero°
 * @since 2023-05-25
 */
@DS("core")
@Mapper
public interface UserAuthExtendMapper extends UserAuthMapper {

    /**
     * 根据手机号查询用户授权信息
     * @param identifier identifier
     * @param authSubject authSubject
     * @return UserInfo
     */
    UserAuthDO selectUserAuthByIdentifier(@Param("identifier") String identifier,
                                          @Param("authSubject") String authSubject);

    /**
     * 根据手机号查询用户授权信息
     * @param identifierMd5 identifierMd5
     * @return UserInfo
     */
    UserAuthDO selectUserAuthByIdentifierMd5(@Param("identifierMd5") String identifierMd5);

    /**
     * 根据用户code获取MD5唯一标识
     * @param userCode
     * @return
     */
    UserAuth getVisitorByUserCode(String userCode);
}
